home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / tbavu503.zip / TBUTIL.DOC < prev    next >
Text File  |  1992-12-29  |  20KB  |  661 lines

  1.  
  2.  
  3.  TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
  4.  
  5.  
  6.                                Table of Contents
  7.  
  8.  
  9.     1. INTRODUCTION...................................... 2
  10.         1.1. Purpose of TbUtil........................... 2
  11.  
  12.     2. USAGE OF THE PROGRAM.............................. 3
  13.         2.1. System requirements......................... 3
  14.         2.2. Program invocation.......................... 3
  15.         2.3. Command line options........................ 3
  16.             2.3.1. immunize ............................. 3
  17.             2.3.2. store ................................ 4
  18.             2.3.3. compare .............................. 4
  19.             2.3.4. restore .............................. 4
  20.         2.4. Examples:................................... 4
  21.         2.5. Using the anti-virus partition.............. 5
  22.  
  23.     3. THE THUNDERBYTE PARTITION CODE.................... 7
  24.         3.1. What is a partition?........................ 7
  25.         3.2. What is a partition table?.................. 7
  26.         3.3. The partition code.......................... 7
  27.  
  28.     4. MISCELLANOUS INFORMATION......................... 10
  29.         4.1. Exit codes................................. 10
  30.         4.2. Recommendations............................ 10
  31.         4.3. DOS Label.................................. 10
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.                                      Page i
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.                                      Page 1
  122.  
  123.  TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
  124.  
  125.  
  126. 1.  INTRODUCTION
  127.  
  128.  
  129.   1.1.  Purpose of TbUtil
  130.  
  131.     TbUtil has been developed as a tool to provide a defense against
  132.     partition table and bootsector viruses.
  133.  
  134.     -   It can save the partition table, bootsector and CMOS data area
  135.         to a file.
  136.  
  137.     -   It can compare and restore the partition table, bootsector and
  138.         CMOS data area after an (virus) accident.
  139.  
  140.     -   It can remove a partition table virus without having to
  141.         low-level format the hard disk, even if there is no backup of
  142.         the partition table.
  143.  
  144.     -   It can create a partition table that has some first-line virus
  145.         defense built-in.
  146.  
  147.     Unlike most file viruses, partition table viruses are hard to
  148.     remove. The only solution is to low-level format the hard disk and
  149.     to make a new partition table, or to make use of undocumented DOS
  150.     commands.
  151.  
  152.     TbUtil makes a backup of the partition table and bootsector, and
  153.     this backup can be used to compare and restore the original
  154.     partition table and bootsector once they are infected. You don't
  155.     have to format your disk anymore to get rid of a partition table or
  156.     bootsector virus.  The program can also restore the CMOS
  157.     configuration.
  158.  
  159.     If your partition table is damaged and you don't have a backup of
  160.     it, TbUtil will try to create a new partition table, avoiding the
  161.     need of a low-level format.
  162.  
  163.     Another important feature is that you can use TbUtil to replace the 
  164.     partition table code with it's own code which is more resistant 
  165.     against viruses. The TbUtil partition code will be executed before 
  166.     the bootsector gains control, so it is able to check the bootsector 
  167.     in a clean environment. Once the bootsector is executed it is 
  168.     difficult to check it, because the virus is already resident in 
  169.     memory and can fool every protection. Instead of booting from a 
  170.     clean DOS diskette just to inspect the bootsector, the TbUtil 
  171.     partition code performs a CRC calculation on the bootsector just 
  172.     before control is passed to it. If the bootsector has been modified 
  173.     the TbUtil partition code will warn you about this. The TbUtil 
  174.     partition code also checks the RAM layout and informs you when it 
  175.     is changed. It does this every time you boot from your hard disk.
  176.  
  177.  
  178.  
  179.  
  180.  
  181.                                      Page 2
  182.  
  183.  TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
  184.  
  185.  
  186. 2.  USAGE OF THE PROGRAM
  187.  
  188.  
  189.   2.1.  System requirements
  190.  
  191.     TbUtil should work on any machine with a working hard disk, and
  192.     with any DOS version.  The program requires only about 64Kb of free
  193.     RAM to execute.
  194.  
  195.  
  196.   2.2.  Program invocation
  197.  
  198.     The use of the program is very easy: just run TbUtil without
  199.     parameters to get a help screen.
  200.  
  201.     The syntax:
  202.                 TBUTIL <option> [=<filename>]
  203.  
  204.  
  205.   2.3.  Command line options
  206.  
  207.     It is possible to specify options on the command line. TbUtil
  208.     recognizes option-characters and option-words. The words are
  209.     easier to remember, and they will be used in this manual for
  210.     convenience.
  211.  
  212.     optionword  parameter short  explanation
  213.     ----------  --------- ---- -------------------------------------
  214.  
  215.     immunize [=<filename>]  i  =Immunize / clean partition table
  216.     store    [=<filename>]  s  =store disk information into data file
  217.     compare  [=<filename>]  c  =compare disk information with data file
  218.     restore  [=<filename>]  r  =restore disk information from data file
  219.  
  220.     All options accept a parameter specifying the filename of the
  221.     TbUtil data file.  The default filename is TBUTIL.DAT and the
  222.     file will be created or used in the current directory.
  223.  
  224.    2.3.1.  immunize (i)
  225.  
  226.     This is a very powerful option, it can be used to clean an
  227.     infected partition table if there is no TbUtil data file, and it
  228.     replaces the existing partition table code by a new partition
  229.     routine that has some virus detection capabilities. The original
  230.     partition code will be saved in a file. You have to run TbUtil
  231.     from a floppy drive or you have to specify the name of the file
  232.     (the specified drive should be a diskette drive) to store the
  233.     original partition code. For more information about the
  234.     new partition code see the next chapter.
  235.  
  236.     If the original partition table is completely damaged and can not 
  237.     be used to built a new one, TbUtil will search the entire disk for 
  238.  
  239.  
  240.  
  241.                                      Page 3
  242.  
  243.  TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
  244.  
  245.  
  246.     information about the original disk layout. TbUtil will also search 
  247.     for TbUtil data files on the hard disk. It is however recommended 
  248.     to store the data file on a diskette, but it is a good idea to keep 
  249.     a copy of it on the hard disk.  Just in case!
  250.  
  251.    2.3.2.  store (s)
  252.  
  253.     This option stores the partition table, bootsector and CMOS data
  254.     area into the TbUtil data file.  Also some additional information
  255.     will be stored in the file to make sure TbUtil will recognize
  256.     this PC as the owner of the partition table and bootsector. This is
  257.     neccesary because restoring the partition table from another PC to
  258.     your PC will destroy all your data at once!
  259.  
  260.     TbUtil will ask you to enter a meaningful description of the
  261.     machine. Enter something like "AT 12MHz, 4Mb, room 12, Mr. Smith".
  262.     You do NOT have to remember it, TbUtil will display it on the
  263.     screen when comparing or restoring, but it helps you to verify that
  264.     the data file belongs to the machine.
  265.  
  266.     It is also possible to check the comment from the DOS command
  267.     prompt. Enter:
  268.                 "Type TbUtil.Dat"
  269.     This will show the comment of the TbUtil.Dat file (without any
  270.     other garbage being displayed).
  271.  
  272.    2.3.3.  compare (c)
  273.  
  274.     This option enables you to check that everything is still Ok.  If
  275.     you specify this option TbUtil will compare the information in
  276.     the TbUtil data file against the partition table, bootsector and
  277.     CMOS data area.  It will also show the comment stored in the data
  278.     file. And of course, if you use this option you will also be sure
  279.     that the TbUtil data file is still readable.
  280.  
  281.    2.3.4.  restore (r)
  282.  
  283.     This option enables you to restore the partition table, bootsector,
  284.     and CMOS data area. It will ask you to confirm that the data file
  285.     belongs to the current machine. Finally it will restore the
  286.     partition table, bootsector of the partition to be used to boot,
  287.     and the CMOS data area.
  288.  
  289.  
  290.   2.4.  Examples:
  291.  
  292.         TbUtil store
  293.  
  294.         TbUtil s
  295.  
  296.         TbUtil s = A:TbUtil.Dat
  297.  
  298.  
  299.  
  300.  
  301.                                      Page 4
  302.  
  303.  TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
  304.  
  305.  
  306.         TbUtil store = A:TbUtil.Dat
  307.  
  308.         TbUtil compare = A:TbUtil.Dat
  309.  
  310.         TbUtil restore = A:TbUtil.Dat
  311.  
  312.         TbUtil immunize = A:\TbUtil.Org
  313.  
  314.         Type A:TbUtil.Dat
  315.  
  316.  
  317.   2.5.  Using the anti-virus partition.
  318.  
  319.     If you install the Thunderbyte partition code (TbUtil immunize),
  320.     you will see the following while booting a clean system:
  321.  
  322.         Thunderbyte anti-virus partition v5.00 (C) 1992 Thunderbyte BV.
  323.  
  324.         Checking bootsector CRC -> OK!
  325.         Checking available RAM -> OK!
  326.         Checking INT 13h -> OK!
  327.  
  328.     If there is a virus in the bootsector or partition table you will
  329.     see this:
  330.  
  331.         Thunderbyte anti-virus partition v5.00 (C) 1992 Thunderbyte BV.
  332.  
  333.         Checking bootsector CRC -> OK!
  334.         Checking available RAM -> Failed!
  335.  
  336.         System might be infected. Continue? (N/Y)
  337.  
  338.     If your system configuration changes, i.e. you update your DOS
  339.     version, or change the amount of memory, you need to update the
  340.     information stored in the immune partition too. You can do this
  341.     with the command "TbUtil immunize".
  342.  
  343.     Some other messages that can be displayed are:
  344.  
  345.         Thunderbyte anti-virus partition v5.00 (C) 1992 Thunderbyte BV.
  346.  
  347.         No system.
  348.  
  349.     There was no active partition on the disk. If you have used the DOS 
  350.     program FDISK to define a new partition, it is likely that you 
  351.     forgot to make one partition "active". Use FDISK to correct the 
  352.     problem.  If this message appears and you did not run a disk 
  353.     partitioner like FDISK, the partition table is damaged. Restore the 
  354.     partition code with TbUtil, or use FDISK to create a new partition 
  355.     table.  Beware, the latter will wipe out all data on the disk.  
  356.     Note that this message is not TbUtil specific, all partition table 
  357.     routines contain messages like this. If this message appears it is 
  358.  
  359.  
  360.  
  361.                                      Page 5
  362.  
  363.  TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
  364.  
  365.  
  366.     never the fault of TbUtil.
  367.  
  368.         Thunderbyte anti-virus partition v5.00 (C) 1992 Thunderbyte BV.
  369.  
  370.         Disk error.
  371.  
  372.     The partition code tried to read the bootsector but the BIOS
  373.     returned an error. The disk is probably defective.
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.  
  402.  
  403.  
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.                                      Page 6
  422.  
  423.  TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
  424.  
  425.  
  426. 3.  THE THUNDERBYTE PARTITION CODE.
  427.  
  428.  
  429.   3.1.  What is a partition?
  430.  
  431.     A partition is a logical drive on a hard disk. One physical hard
  432.     disk can contain mulitple DOS partitions. Every DOS partition has
  433.     its own drive ID (C: D: E:).
  434.  
  435.  
  436.   3.2.  What is a partition table?
  437.  
  438.     How does the system know about the disk lay-out? How does the
  439.     system know where a partition starts and ends?
  440.     This is defined by the partition table. The partition table contains
  441.     the start and end cylinder of every partition. The partition table
  442.     also carries information about the operating system of a partition
  443.     and which partition should be used to boot. The partition table is
  444.     always located at the first sector of the hard disk.
  445.  
  446.  
  447.   3.3.  The partition code
  448.  
  449.     The first sector of the hard disk contains the partition table, but
  450.     it also contains a piece of code. This code will be called by the
  451.     BIOS boot-routine of the machine. It is the first piece of non-BIOS
  452.     code that will be executed. The partition code normally interprets
  453.     the partition table, and determines which partition should be used
  454.     to boot. It reads the bootsector of the bootable partition and
  455.     transfers control to it. The bootsector invokes the DOS hidden
  456.     files and the system fires up.
  457.  
  458.     Since the partition code does not do very much and is a very small
  459.     routine (about 80 bytes) you will never notice that it is there and
  460.     is executed every time you boot.
  461.  
  462.     However, there are some viruses which overwrite the existing
  463.     partition table or bootsector, and while performing the normal boot
  464.     procedure, the code remains resident in memory and infects every
  465.     diskette. When there is a virus in a file, you can easily get rid
  466.     of the virus by deleting the infected file. However, the partition
  467.     table can not be deleted, and the only thing a user can do is to
  468.     low-level format the hard disk and to re-partition it, take their
  469.     chances with undocumented DOS commands, or to use TbUtil (or a
  470.     similar product) to restore the original partition table.
  471.  
  472.     Anyway, it is often difficult to detect a partition or
  473.     bootsector virus, since the virus is already resident in memory
  474.     when DOS and eventually an anti-virus product fires up. Like any
  475.     other memory resident program, a virus can do anything. The virus
  476.     intercepts the BIOS calls, and if an anti-virus product (a scanner
  477.     or checksummer) wants to read the bootsector in order to inspect
  478.  
  479.  
  480.  
  481.                                      Page 7
  482.  
  483.  TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
  484.  
  485.  
  486.     it, the virus intercepts the BIOS request, and supplies the program
  487.     with an unaltered copy of the original bootsector stored somewhere
  488.     on the disk, instead of the infected bootsector. This means that a
  489.     well-designed bootsector virus can hide itself completely from
  490.     anti-virus products. To detect the virus, you have to be sure the
  491.     virus is not resident in memory. There are only two possibilities
  492.     to achieve this:
  493.  
  494.     -   By booting from a clean DOS diskette (the virus is not executed
  495.         and not resident in memory and can not prevent the anti-virus
  496.         program to read it)
  497.  
  498.     -   By executing a piece of software that is executed before the
  499.         bootsector gains control. The only software that is executed
  500.         before the bootsector gains control is the machine BIOS and
  501.         additional hardware (like Thunderbyte) and the partition code...
  502.  
  503.     Except for hardware immunizers (like Thunderbyte) only the
  504.     partition code will be executed before the bootsector gains
  505.     control, so only a routine in the partition code can safely check
  506.     the bootsector while booting from the harddisk.
  507.  
  508.     This consideration has lead to the development of the Thunderbyte
  509.     anti-virus partition code. The Thunderbyte anti-virus code performs
  510.     the normal tasks of the partition code, but it also has some
  511.     additional routines, which check the CRC (a sophisticated sort of
  512.     checksum) of the bootsector, the amount of free RAM, and the
  513.     location of the INT 13h handler.
  514.  
  515.     Smart users will have noticed that we changed our subject from
  516.     partition viruses to bootsector viruses. The bootsector can be
  517.     checked completely by the partition code, but how about the
  518.     partition code itself? The answer is that it is not possible to
  519.     check the partition code accurately. This can only be done by
  520.     hardware like the Thunderbyte add-on card. However, we have
  521.     built-in some additional tools to detect partition table viruses.
  522.     To know how they work additional information about partition
  523.     viruses is required.
  524.  
  525.     A partition virus that wants to hide itself has to remain resident
  526.     in memory and has to intercept all attempts to read the partition
  527.     code. Since the partition code is normally removed from memory as
  528.     soon as DOS fires up, the partition virus has to 1) allocate some
  529.     memory to remain resident. The virus also has to intercept all
  530.     requests to read the partition code in order to hide itself, so it
  531.     has to 2) hook the BIOS INT 13h call. After the virus is memory
  532.     resident, the virus reads the original partition code and transfers
  533.     control to it. For the user nothing has changed...
  534.  
  535.     When installing the Thunderbyte partition code, TbUtil determines
  536.     the amount of RAM at system startup and it calculates the CRC of
  537.     the bootsector of the bootable harddisk partition. Both values are
  538.  
  539.  
  540.  
  541.                                      Page 8
  542.  
  543.  TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
  544.  
  545.  
  546.     stored in the partition code.
  547.  
  548.     If there is a virus in the bootsector the CRC does not match
  549.     anymore, and the partition code will notify the user of this. If
  550.     the partition code has been overwritten by a virus, and the virus
  551.     has installed itself in memory before invoking the Thunderbyte
  552.     partition code, the amount of available RAM has been decreased.
  553.     The Thunderbyte partition code will notify the user about the
  554.     unexepected RAM decrease. Finally, the partition code will check
  555.     whether INT 13h points to ROM or RAM. Usually, the partition code
  556.     is the first piece of software being executed, so INT 13h should
  557.     point to ROM. If it points to RAM it means that another piece of
  558.     software has been executed before the Thunderbyte partition gained
  559.     control, and it is likely that it is a virus. If the virus did not
  560.     hook INT 13h, it would be possible to detect the virus with a
  561.     normal virus scanner or checksummer. Anyway, if INT 13h points to
  562.     RAM, the Thunderbyte partition code will notify the user of this.
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.  
  592.  
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.  
  600.  
  601.                                      Page 9
  602.  
  603.  TbUtil anti virus tool. (C) Copyright 1988-92 Thunderbyte B.V.
  604.  
  605.  
  606. 4.  MISCELLANOUS INFORMATION
  607.  
  608.  
  609.   4.1.  Exit codes
  610.  
  611.     TbUtil terminates with one of the following exit codes:
  612.         Errorlevel 1 when option 'compare' fails or an error occurs.
  613.         Errorlevel 0 when everything was okay.
  614.  
  615.  
  616.   4.2.  Recommendations
  617.  
  618.     Since the PC is completely inaccessable to DOS if the partition
  619.     table gets damaged, it is HIGHLY RECOMMENDED to store both the
  620.     TbUtil data file and the program TbUtil.Exe itself on a diskette!
  621.     It is not nice if the partition table is destroyed, and the only
  622.     solution to the problem resides on the same inaccessable disk...
  623.  
  624.     If you own more than one PC, create one TbUtil diskette with all
  625.     TbUtil data files of all your PC's on it.  Just execute "TbUtil 
  626.     store = a:TbUtil.<number>" on every PC's.  The number specifies 
  627.     the number (or even name) of the PC.
  628.  
  629.     Do NOT automatically invoke TbUtil from within the autoexec.bat
  630.     file with the 'store' option set. If you do this, the data file will
  631.     be overwritten by the virus immediately after the disk gets
  632.     infected. However, if you - for some reason - want to use the
  633.     'store' option without being prompted for the comment, use DOS
  634.     redirection to add a standard comment. For example:
  635.         TbUtil store < A:\Comment.Dat
  636.  
  637.  
  638.   4.3.  DOS Label
  639.  
  640.     DOS 5.00 and above store the disk label not only in the root
  641.     directory but also in the bootsector!
  642.  
  643.     This means that if you change the label of the disk using the DOS
  644.     'label' command TbUtil will report that the bootsector has been
  645.     changed!
  646.  
  647.     Make a new copy of the bootsector and/or replace the Thunderbyte
  648.     partition code.
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.                                     Page 10